Subversion to Git Migration

您所在的位置:网站首页 svn github Subversion to Git Migration

Subversion to Git Migration

#Subversion to Git Migration| 来源: 网络整理| 查看: 265

Migrating GitHub importer

For Internet-accessible projects, GitHub.com provides Importer for automatic migration and repository creation from Subversion, Team Foundation Server, Mercurial, or alternatively-hosted Git version controlled projects.

The process is as simple, needing only you to sign into your GitHub account, if you aren鈥檛 already, entering your existing project鈥檚 version control URL in the repository field, and initiating the conversion.

Depending on the detected version control system, Importer may request additional information for migration. This includes a mapping file for associating Subversion usernames with Git fields.

Read more about how to import your project into GitHub by looking at the full GitHub Importer documentation.

SVN2Git Utility

When access limitations or non-public Subversion repositories need porting to Git, the SVN2Git utility is the command line utility of choice and provides control through every step of the process.

Subversion presents distinct differences in structure to that of a Git repository, and SVN2Git provides the flexibility and configuration for traditional and custom Subversion layouts. This ensures the resulting Git repository aligns with standard best practices for commits, branches, and tags for the entire project鈥檚 history.

Notable features of SVN2Git include:

Converting all SVN conventions to traditional Git structure - Providing SVN users field to name and email data in Git commits Permitting exclusion patterns for precise Git repository content

Learn more about SVN2Git at the project鈥檚 official home page:

https://github.com/nirvdrum/svn2git

Bridging Leveraging Git鈥檚 support of SVN

Often times, during a transition to Git, the Subversion infrastructure remains in place while users become acquainted with local Git repository interactions, local workflows, and desktop applications.

The git svn command permits users to synchronize with a centralized Subversion repository host while taking advantage of all the benefits local Git command line and graphical clients have to offer.

To acquire a Subversion repository as a resulting local Git repository, download the project in its entirety with this command:

git svn clone [svn-repo-url] --stdlayout

Make certain you are familiar with the targeted Subversion repository鈥檚 structure and whether it follows the standard layout or not. For non-traditional trunk, branches, and tags layouts, the following option switches should be specified during the svn clone:

T [trunk] for alternate main source convention b [branches] for alternate branch location t [tags] for alternate tag structure location

Once the clone operation completes, you can proceed with any local Git interactions on the command line or with graphical clients.

Synchronizing with Subversion

Publishing local Git history back to a central Subversion repository acquired with git svn clone is performed with one command:

git svn dcommit

If the hosted Subversion repository鈥檚 history possesses commits not yet in the local Git repository, the dcommit operation will be rejected until the commits are acquired with this command:

git svn rebase

Keep in mind this action rewrites your local Git history and your commit identifiers will be different.

Understanding

Subversion and Git share similar vocabularies, but the commonality often is only is command names. Behavior and functionality are quite distinct given the unique qualities Git provides as a distributed version control system when compared to the centralized aspects of Subversion.

SVN command Git command Git behavior status status Report the state of working tree add add Required for each path before making a commit commit commit Store prepared changes in local revision history rm, delete rm Prepare paths for deletion in next commit move mv Prepare relocated content for next commit checkout clone Acquire the entire history of a project locally for the first time 聽 branch Create local context for commits 聽 merge Join branch histories and changes to working tree 聽 log No network required 聽 push Upload commit history to GitHub/centralized Git host 聽 pull Download and integrate GitHub repository history with local on 聽 fetch Download GitHub repository history with no other action


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3